package com.wenguo.common.util;

import java.util.Date;
import java.text.SimpleDateFormat;

public final class TimeUtil {

	private TimeUtil() {
		
	}
	
	/**
	 * Get date at current<p>
	 * Format: <code>yyyy-MM-dd</code>
	 * @return current date
	 */
	public static String getShortFormatDate() {
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
		String time = sdf.format(new Date());
		return time;
	}
	
	/**
	 * Get date at current<p>
	 * Format: <code>yyyy-MM-dd HH:mm:ss</code>
	 * @return current date
	 */
	public static String getFullFormatDate() {
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		String time = sdf.format(new Date());
		return time;
	}

	/**
	 * Get date at current<p>
	 * Format: <code>yyyyMMddHHmmsshh</code>
	 * @return current date
	 */
	public static String getNoFormatDate() {
		SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmsshh");
		String time = sdf.format(new Date());
		return time;
	}
	
	public static String getShortFormatLaterNyearDate(int n) {
		String shortDate = getShortFormatDate();
		int i = shortDate.indexOf("-");
		return (Integer.parseInt(shortDate.substring(0,i)) + n) + shortDate.substring(i);
	}
}
